<?php
/**
 * Description of ValidateDateYMD
 *
 * @author Damiano Ciarla
 */
class ValidateDateYMD implements Validate
{
    public function validate($field, $value, $condition = null)
	{
		if(!is_null($value) && strlen($value) > 0)
			if(!preg_match("/(19|20)[0-9]{2}[- \/](0[1-9]|1[012])[- \/](0[1-9]|[12][0-9]|3[01])/", $value))
				return T::_("Il campo") . " <b><u>" . ucfirst($field) . "</u></b> " . T::_("ha un formato data non valido");

		return true;
	}
}
?>
